The present invention relates to computer systems having multiple parallel processors, and more particularly to a method for a process requesting access to a second process that is currently owned by the requesting process to have its request extend the current tenure of the second process such that all of the requests of the current owning process are fulfilled before the second process is released.
In systems with multiple parallel processors, data and resources are typically shared by the various tasks being performed by the multiple processors. Since more than one processor may request the use of shared data or resources at a time, some method of operation must be provided to ensure data coherency, such that only the currently accessing processor may access and change the shared data. A similar method of operation must be provided to ensure the coherency of data provided to a shared resource and its software interface. For example, something must prevent two or more processors from outputting data from two different files to a shared printer at the same time. Otherwise, the page printed may have characters and words that are an unintelligible and incoherent admixture of the two data files.
A common way to ensure the coherency of shared data and shared resources in UNIX computer systems (UNIX is a registered trademark of UNIX Systems Laboratory Corporation) and computer systems with operating systems similar to UNIX is to provide a synchron-ization lock for the shared data or resource. The synchronization lock locks out access by any processor or process until the currently accessing process, referred to as the owner, has completed the access that is currently executing.
The capability to lock out all competing requests for the period of the required access is provided by a synchronization lock. This is accomplished by a portion of the process that accesses the shared data or resource first requesting ownership of the synchronization lock by means of a locking synchronization process, called a primitive, before actually accessing the shared data or resource. If the synchronization lock is not owned at the time, the requesting process is assigned ownership of the synchronization lock and the requesting and owning process accesses to the shared data or resource. After the access is completed, the requesting and owning process releases the shared data or resource by means of an unlocking synchronization primitive. Such operations are well known by those skilled in the use of the UNIX operating system.
A problem arises when the process which is the owner of the synchronization lock requests a further access to the shared process while the shared process is occupied with a current access from the owner. Such a situation, if the shared data or resource is essential to the further execution of the owning process, the owning process may hold the locked process or resource, on the one hand, while also waiting for the locked process or resource to be released, on the other hand. This leads to a deadlock condition where the requesting and owning process cannot progress any further, since it is both holding the lock and waiting for the locked process or resource to be released, if some type of deadlock prevention is not included.
Another problem that occurs when the owning process must make an additional access to the locked process or resource that is currently owned, is the problem of processing inefficiency. When an owning process must release a synchronous lock and a subsequent process acquires that synchronous lock considerable amount of processor time is consumed. When the subsequent processor releases the synchronous lock and it is re-acquired by the previous owner even more processor time is consumed. Furthermore, if one or both of the processors switch context while waiting to acquire ownership of the requested synchronization lock, even more processor time will be consumed. The processing time consumed is an inefficient use of the system's data processing capabilities and such consumption should be kept as low as possible.
Therefore, it is an object of this invention to provide a method for extending a tenure level of an owning process to a shared process or resource to prevent a deadlock condition and to decrease inefficiency.
It is another object of this invention to provide a method for incrementally releasing a tenure level that maintains lock ownership until all current requests of a current lock owner are fulfilled.